<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增账单管理')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<!--        <input name="projects" id="projects" type="hidden" th:value="${projects}">-->
        <form class="form-horizontal m" id="form-bill-add">
			
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">序号：</label>
                <div class="col-sm-8">
                    <input name="serialNumber" class="form-control" type="text" required>
                </div>
            </div>
			
			<div class="form-group">
			    <label class="col-sm-3 control-label is-required">项目名称：</label>
			    <div class="col-sm-8">
			        <input name="projectName" class="form-control" type="text" required>
			    </div>
			</div>
            <div class="form-group">
			    <label class="col-sm-3 control-label is-required">单位名称：</label>
			    <div class="col-sm-8">
			        <input name="companyName" class="form-control" type="text" required>
			    </div>
			</div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">收费类型：</label>
                <div class="col-sm-8">
                    <input name="chargeType" class="form-control" type="text" required>
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label ">票据开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="billingTimeStart" class="form-control" placeholder="请填写日期" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">票据结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="billingTimeEnd" class="form-control" placeholder="请填写日期" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">开票时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="billingTime" class="form-control" placeholder="请填写日期" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">开票金额：</label>
                <div class="col-sm-8">
                    <input name="billCount" class="form-control" type="text">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">发票号：</label>
                <div class="col-sm-8">
                    <input name="billNumber" class="form-control" type="text">
                </div>
            </div>


            <div class="form-group">    
                <label class="col-sm-3 control-label">到账金额：</label>
                <div class="col-sm-8">
                    <input name="receivedCount" class="form-control" type="text">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">到账时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="receivedTime" class="form-control" placeholder="请填写日期" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>

			
            <div class="form-group">
                <label class="col-sm-3 control-label">到账状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <label class="radio-box"> <input type="radio"  name="receivedStatus" value="0"/> 未到账 </label>
                        <label class="radio-box"> <input type="radio"  name="receivedStatus" value="1" /> 已到账 </label>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "guomao/billManagement"

        $(function(){
            initChoice();
        })

        function initChoice(){
            $("#chooseCharge input").each(function(){
               $(this).parent().addClass("checked")
               $(this).attr("checked",true)
            });
        }


    $("#form-bill-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-bill-add').serialize());
            }
        }

        $("input[name='billingTimeStart']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='billingTimeEnd']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='billingTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='receivedTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });


    </script>
</body>
</html>